use MooseX::Declare;
use MooseX::NonMoose;

class GDoc::CGI extends CGI::Application is mutable { 
    require CGI::Application::Plugin::JSON;
    CGI::Application::Plugin::JSON->import( ':all' );

    method setup {
        $self->start_mode( 'main' );
        $self->mode_param( 'rm' );

        my @methods = map { $_->name } $self->meta->get_all_methods;
    
        $self->run_modes( map  { /^rm_(.+)$/  => $_ }
                          grep { /^rm_/ }
                          @methods
                        );
    }

    __PACKAGE__->meta->make_immutable( inline_constructor => 0 );
}


1;

